﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

using FluentNHibernate.Conventions;

namespace Domain.Model.Mapping.Conventions
{
    /// <summary>
    /// This class is used to make sure, that column
    /// storing foreign keys are not allowed to be null.
    /// </summary>
    public class NotNullReferenceConvention : IReferenceConvention
    {
        public void Apply(FluentNHibernate.Conventions.Instances.IManyToOneInstance instance)
        {
            instance.Not.Nullable();
        }
    }
}